package com.neusoft.oa.serviceImp;

import com.neusoft.oa.mapper.NoticeMapper;
import com.neusoft.oa.pojo.Notice;
import com.neusoft.oa.service.INoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeServiceImp implements INoticeService {

    @Autowired(required = false)
    NoticeMapper noticeMapper;

    @Override
    public List<Notice> noticeList(Notice notice) {
        return noticeMapper.noticeList(notice);
    }

    @Override
    public boolean noticeUpdate(Notice notice) {
        int n= noticeMapper.noticeUpdate(notice);
        if(n>0)
            return true;
        return false;

    }

    @Override
    public boolean noticeDelete(int id) {
        int n=noticeMapper.noticeDelete(id);
        if(n>0)
            return true;
        return false;
    }

    @Override
    public boolean noticesDelete(int []notices) {
        int n = noticeMapper.noticesDelete(notices);
        if (n > 0)
            return true;
        return false;
    }

    @Override
    public boolean noticeInsert(Notice notice) {
        int n=noticeMapper.noticeInsert(notice);
        if(n>0)
            return true;
        return false;
    }
}
